Page: | 1 |
Topic:

[en] Tip: How to make another type of displaying subpages like FAQ.

Makaron
OpenSolution
See profile of: Makaron
2009-05-13 12:22:04
Votes: 0
Vote answer in plus Vote answer in minus
I prepared this tip for Quick.Cms.Lite but it can be used also in Quick.Cart.

Hello I want to show You how to make additional type of displaying subpages which You can use for build FAQ on Your site or whatever You want.
Here You can find ready example of this tip: http://www.portfolio.makaron.info.pl/projekty/Quick.Cms.Lite_v2.3_subpages_faq/?our-offer,3

Ok now what You have to do.. First You should edit file lang/xx.php and add next variable: $lang['Subpage_show_3'] it will be the name of our new type.
Next You have to edit file core/common-admin.php find function throwSubpagesShowSelect() and after line:
$aSubpages[2] = $GLOBALS['lang']['Subpage_show_2'];
add new one:
$aSubpages[3] = $GLOBALS['lang']['Subpage_show_3'];

Now change in file core/pages.php but it is optionally. I changed in function listSubpages() code:
if( $iType > 1 ){
   $aData['sImage'] = $oTpl->tbHtml( $sFile, 'SUBPAGES_NO_IMAGE_'.$iType );
for:
if( $iType > 1 && $iType != 3 ){
   $aData['sImage'] = $oTpl->tbHtml( $sFile, 'SUBPAGES_NO_IMAGE_'.$iType );
because I don't want to display images in this type. When You want to display images You don't have to do anything.
Now we editing file actions_client/p.php line:
if( $aData['iSubpagesShow'] < 3 )
for:
if( $aData['iSubpagesShow'] < 4 )

In file templates/pages_default.tpl we have to add some blocks here there are:
<!-- BEGIN SUBPAGES_LIST_3 --><li class="l$aData[sStyle]"><h4>$aData[sName] <a href="#faq$aData[sStyle]" onclick="displaySubpage( 'faq$aData[sStyle]' );">+</a> <a href="#faq$aData[sStyle]" onclick="hideSubpage( 'faq$aData[sStyle]' );">-</a></h4>$aData[sDescriptionShort]</li><!-- END SUBPAGES_LIST_3 -->
<!-- BEGIN SUBPAGES_DESCRIPTION_3 --><h5 id="faq$aData[sStyle]">$aData[sDescriptionShort]</h5><!-- END SUBPAGES_DESCRIPTION_3 -->
<!-- BEGIN SUBPAGES_HEAD_3 --><ul class="subpagesList" id="subList1"><!-- END SUBPAGES_HEAD_3 -->
<!-- BEGIN SUBPAGES_FOOT_3 --></ul><!-- END SUBPAGES_FOOT_3 -->

In file plugins.css we have to add these two lines:
#subList1 li h5{display:none;}
#subList1 li h4 a{text-decoration:none;font-size:1.4em;}

And last thing we have to do is to add two functions in file core/plugins.js here there are:
function displaySubpage( sBlock, oObj ){
  var bCheck = false;
  if( !oObj ){
    var bCheck = true;
  }
  if( gEBI( sBlock ).style.display == 'block' && bCheck === true )
    gEBI( sBlock ).style.display = 'none';
  else
    gEBI( sBlock ).style.display = 'block';
} // end function displayBlock

function hideSubpage( sBlock, oObj ){
  var bCheck = false;
  if( !oObj ){
    var bCheck = true;
  }
  if( gEBI( sBlock ).style.display == 'none' && bCheck === true )
    gEBI( sBlock ).style.display = 'block';
  else
    gEBI( sBlock ).style.display = 'none';
} // end function displayBlock

When You make all these steps You should recieve new type like in example. I hope someone will enjoy it.

PS: Sorry for my english..

  » Quick.Cart v3.x
grzdak
See profile of: grzdak
2011-12-26 17:19:52
Votes: 0
Vote answer in plus Vote answer in minus
Makaron, czy mógłbyś odświeżyć przykład? nie można podejrzeć do jakiego efektu dążymy.
Ja chciałabym wyświetlić subpages w dwóch kolumnach bez zdjęć i nie wiem czy to będzie to...
G
Makaron
OpenSolution
See profile of: Makaron
2011-12-27 15:43:51
Votes: 0
Vote answer in plus Vote answer in minus
Proszę: http://www.mak-web.pl/projekty/Quick.Cms.Lite_v2.3_subpages_faq/?our-offer,3
Pamiętaj jednak, że to starsza wersja.

-------------------------------------------------------
I helped? Like it: www.facebook.com/makwebpl
leendert12
See profile of: leendert12
2012-01-13 19:42:48
Votes: 0
Vote answer in plus Vote answer in minus
Hi Makaron, can this also be integrated in QC 4.2?
Makaron
OpenSolution
See profile of: Makaron
2012-01-16 15:35:09
Votes: 0
Vote answer in plus Vote answer in minus
I don't know.. Just try. ;)

-------------------------------------------------------
I helped? Like it: www.facebook.com/makwebpl
Page: | 1 |
 


If You want to do this operation, please log in first ».
If You don't have an account please register ».
Valid XHTML 1.0! Valid CSS! version: 2.2.0-alfa | powered by Quick.Forum